package model;

import model.sqlite.SqliteDAOFactory;
import model.xml.XMLDAOFactory;

/**
 * Classe abstraite de gestion de la couche persistance des données
 * @author Francis
 * @version 1.0
 */

public abstract class DAOFactory
{

	/**
	 * Liste des types Data Access Object supporté par le factory
	 */
	public static final int SQLITE = 1;
	public static final int XML= 2;

	/**
	 * Methode permettant la selection du factory souhaite
	 */
	public static DAOFactory getDAOFactory(int whichFactory)
	{
		switch (whichFactory) 
		{
			case SQLITE: 
				return new SqliteDAOFactory();
			case XML: 
				return new XMLDAOFactory();      
			default           : 
				return null;
		}
	}
	
	public abstract TypeOperationDAO getTypeOperation();
	
	public abstract void close();
}
